//
//  ViewController.m
//  CPAlertView
//
//  Created by 美鑫科技 on 16/5/28.
//  Copyright © 2016年 MorpLCP. All rights reserved.
//

#import "ViewController.h"
#import "CPAlertView.h"

@interface ViewController ()<CPAlertViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(10, 80, self.view.frame.size.width - 20, 50)];
    lbl.text = @"点击屏幕弹出来";
    lbl.textAlignment = NSTextAlignmentCenter;
    lbl.textColor = [UIColor lightGrayColor];
    [self.view addSubview:lbl];
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    CPAlertView *alert = [[CPAlertView alloc] initWithTitle:@"提示" message:@"我弹出来啦！" delegate:self style:(CPAlertViewStyleDark) buttons:@"知道啦", @"去死吧", nil];
    [alert show];
}

- (void)alertView:(CPAlertView *)alertView buttonIndex:(NSInteger)btnIndex{
    if (btnIndex == 0) {
        NSLog(@"嗯");
    } else {
        NSLog(@"狗带");
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
